import { Component } from '@angular/core';
import { ModalService, ConfirmService, Pagination } from 'ng-tui';
import { CostService } from '../../services/cost.service';
import { Goods } from '../../interfaces/cost.interface';
import { ApiData, SearchParams } from '../../../../cores/classes';
import { RequestService, GlobalService } from '../../../../cores/services';
@Component({
    template: `
    <div class="modal-header">
    <h5 class="modal-title">新增费用名称</h5>
    <button (click)="close()" type="button" class="close">
        <span aria-hidden="true">&times;</span>
    </button>
</div>
<div class="modal-body">
    <div style="flex: 1 1 auto;padding: 1.25rem 0rem 1.25rem 0rem;">
        <div class="form-group row" style="display:flex;">
            <label class="col-sm-2 col-form-label label-required text-right" style="padding-right: 0px;">所属类别</label>
            <div class="col-sm-4">
                <select class="form-control hgt p-0 form-selt ht prod-input">
                    <option ></option>
                </select>
            </div>
            <label class="col-sm-2 col-form-label label-required text-right" style="padding-right: 0px;">上级</label>
            <div class="col-sm-4">
                <select class="form-control hgt p-0 form-selt ht prod-input">
                    <option ></option>
                </select>
            </div>
        </div>
        <div class="form-group row">
            <label class="col-sm-2 col-form-label label-required text-right" style="padding-right: 0px;">费用名称</label>
            <div class="col-sm-10">
                <input type="text" class="form-control">
            </div>
        </div>
        <div class="form-group row" style="display:flex;">
            <label class="col-sm-2 col-form-label label-required text-right" style="padding-right: 0px;">库存补扣</label>
            <div class="col-sm-4">
                <select class="form-control hgt p-0 form-selt ht prod-input">
                    <option ></option>
                </select>
            </div>
            <label class="col-sm-2 col-form-label label-required text-right" style="padding-right: 0px;">票折</label>
            <div class="col-sm-4">
                <select class="form-control hgt p-0 form-selt ht prod-input">
                    <option ></option>
                </select>
            </div>
        </div>
        <div class="form-group row" style="display:flex;">
            <label class="col-sm-2 col-form-label label-required text-right" style="padding-right: 0px;">所属科目</label>
            <div class="col-sm-4">
                <select class="form-control hgt p-0 form-selt ht prod-input">
                    <option ></option>
                </select>
            </div>
            <label class="col-sm-2 col-form-label label-required text-right" style="padding-right: 0px;">有效</label>
            <div class="col-sm-4">
                <select class="form-control hgt p-0 form-selt ht prod-input">
                    <option ></option>
                </select>
            </div>
        </div>
        <div class="form-group row">
            <label class="col-sm-2 col-form-label label-required text-right" style="padding-right: 0px;">备注</label>
            <div class="col-sm-10">
                <input type="text" class="form-control">
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button tsBtn (click)="modal.dismiss()">取消</button>
        <button tsBtn loading color="success" (submit)="confirmSave($event)">保存</button>
    </div>`,
})
export class ModalCostComponent {
    // name="couponName"[(ngModel)]="voucher.couponName"
    // content = '...';
    // voucher: Voucher = { id: 0, isActive: 1, couponName: '', };
    // *ngFor="let item of getlista" [ngValue]="item.id"
    // {{item.departmentName}}


    changg: number;
    loading = false;
    search = new SearchParams({ status: '' });
    pagination = new Pagination();

    nowD = new Date();



    constructor(
        private modal: ModalService,
        private costService: CostService,
        private confirm: ConfirmService,
        public global: GlobalService,
    ) { }


    close() {
        this.modal.dismiss();
    }


    confirmSave(btn: any) {

    }
    // testa() {
    //     this.voucherService.insertCompany(this.voucher).subscribe({
    //         next: res => {
    //             this.confirm.success('添加成功', `'${this.voucher.couponName}`);
    //             this.close();
    //             this.loadDatas();

    //         }
    //     });
    // }


}

